package com.wangxiang.shop.order.controller;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.wangxiang.common.utils.PageEntity;
import com.wangxiang.shop.order.feign.ManageFeign;
import com.wangxiang.shop.order.feign.MemberFeign;
import com.wangxiang.shop.order.feign.ProductFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.wangxiang.shop.order.entity.UnsubscribeOrderEntity;
import com.wangxiang.shop.order.service.UnsubscribeOrderService;
import com.wangxiang.common.utils.PageUtils;
import com.wangxiang.common.utils.R;



/**
 * 
 *
 * @author wangxiang
 * @email 2293672863@qq.com
 * @date 2022-04-24 11:17:50
 */
@RestController
@RequestMapping("order/unsubscribe")
public class UnsubscribeOrderController {
    @Autowired
    private UnsubscribeOrderService unsubscribeOrderService;
    @Autowired
    MemberFeign memberFeign;
    @Autowired
    ProductFeign productFeign;
    @Autowired
    ManageFeign manageFeign;


    @RequestMapping("page")
    public R page(@RequestBody HashMap<String , Integer> map){
        PageEntity page = unsubscribeOrderService.page(map);
        List<HashMap<String, Object>> list = unsubscribeOrderService.pageList((List<UnsubscribeOrderEntity>) page.getList());
        List<HashMap<String, Object>> list1 = manageFeign.orderList(list);
        List<HashMap<String, Object>> list2 = productFeign.memberOrderList(list1);
        List<HashMap<String, Object>> list3 = memberFeign.memberOrderList(list2);


        return R.ok().put("page",page).put("list",list3);


    }


}
